package com.coderlin.service.impl;

import com.coderlin.entities.Salary;
import com.coderlin.mapper.SalaryMapper;
import com.coderlin.service.SalaryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <Description> <br>
 *
 * @author Coder_Lin<br>
 * @version 1.0<br>
 * @taskId: <br>
 * @createDate 2021/07/28 9:47 <br>
 * @see com.coderlin.service.impl <br>
 */
@Service
public class SalaryServiceImpl implements SalaryService {
    @Autowired
    private SalaryMapper salaryMapper;
    /**
     * 列出员工工作以来获取的所有工资
     *
     * @return
     */
    @Override
    public List<Salary> listSalary() {
        return salaryMapper.listSalary();
    }

    /**
     * 根据传入的时间查询区间内工人的工资
     *
     * @param timeStart
     * @param timeEnd
     * @return
     */
    @Override
    public List<Salary> calcSalary(String workerName, String timeStart, String timeEnd) {
        return salaryMapper.calcSalary(workerName,timeStart,timeEnd);
    }
}
